﻿<%@ Page ValidateRequest="false" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Index</title>
    <link href="/css/flick/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="/js/jquery-ui-1.8.6.custom.min.js" type="text/javascript"></script>
    <link href="/css/jquery.jnotify.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery.jnotify.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
//            var content = $.ajax({
//                url: "/Home",
//                async: false
//            }).responseText;

//            //set the value of the content into a textarea by creating a textarea & setting the content value to it.
//            $("#dynamicContent").html(content);
            //$("#dynamicContent").load("/Home");
            // For jNotify Inizialization
            // Parameter:
            // oneAtTime : true if you want show only one message for time
            // appendType: 'prepend' if you want to add message on the top of stack, 'append' otherwise
            $('#StatusBar').jnotifyInizialize({
                oneAtTime: false,
                appendType: 'append'
            })
            $('#Notification')
                .jnotifyInizialize({
                    oneAtTime: false,
                    appendType: 'append'
                })
                .css({ 'position': 'absolute',
                    'marginTop': '20px',
                    'right': '20px',
                    'width': '250px',
                    'z-index': '9999'
                });
            // --------------------------------------------------------------------------

            // For add a notification on button click
            // Parameter:
            // text: Html do you want to show
            // type: 'message' or 'error'
            // permanent: True if you want to make a message permanent
            // disappearTime: Time spent before closing message


            $('#addStatusBarError').click(function () {
                $('#StatusBar').jnotifyAddMessage({
                    text: 'This is a permanent error.',
                    permanent: true,
                    type: 'error'
                });
            });

            $('#addNotificationMessage').click(function () {
                $('#Notification').jnotifyAddMessage({
                    text: 'This is a non permanent message.',
                    permanent: false
                });
            });

            $('#addNotificationError').click(function () {
                $('#Notification').jnotifyAddMessage({
                    text: 'This is a permanent error.',
                    permanent: true,
                    type: 'error'
                });
            });
            // -----------------------------------------------------
        });
        function ShowWarning() {
            $('#StatusBar').jnotifyAddMessage({
                text: 'This is a non permanent message.',
                permanent: false,
                disappearTime: 10000
            });
        }
        function ShowWarningString(txt) {
            $('#StatusBar').jnotifyAddMessage({
                text: txt,
                permanent: false,
                disappearTime: 10000
            });
        }
    </script>
</head>
<body>
    <div id="StatusBar">
    </div>
    <div>
        <%: Ajax.ActionLink("Show", "ShowWarning", null)%>
        <% using (Ajax.BeginForm("ShowWarningString", null))
           {%>
        <input type="text" name="txt" />
        <input type="submit" />
        <% 
            }%>
    </div>
    <div id="dynamicContent">
    </div>
</body>
</html>
